package com.itsv.xhyy;

import java.util.ArrayList;

import com.itsv.cyzx.adapter.PageListView_Adapter;
import com.itsv.cyzx.bean.Me_DetailBean;

import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.MotionEvent;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import android.widget.ListView;
import android.widget.TextView;

public class MagazineListPageActivity extends Activity implements OnItemClickListener{
	
	private ListView listview=null;
	private ArrayList<Me_DetailBean> list = null;
	private PageListView_Adapter adapter=null;
	private Intent intent=null;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		// TODO Auto-generated method stub
		super.onCreate(savedInstanceState);
		setContentView(R.layout.layout_magazine_page);
		initView();
	}
	
	private void initView(){
		listview=(ListView) findViewById(R.id.listview_page);
		intent= getIntent();
		list=(ArrayList<Me_DetailBean>) intent.getSerializableExtra("list");
	
		adapter=new PageListView_Adapter(this, list);
		listview.setAdapter(adapter);
		listview.setOnItemClickListener(this);
	}
	
	@Override
	public boolean onTouchEvent(MotionEvent event){
		finish();
		return true;
	}

	@Override
	public void onItemClick(AdapterView<?> arg0, View arg1, int arg2, long arg3) {
		// TODO Auto-generated method stub
		Intent intent=new Intent();
		intent.putExtra("index", arg2);
		setResult(1, intent);
		this.finish();
	}
}
